<?php
/*
Template Name: Dịch vụ
*/
?>
<?php $current_term = get_queried_object(); //var_dump($current_term) ?>

<?php get_header() ?>

    <div class="page_title">

        <div class="container">
            <div class="leaft_title"><h1><?php echo $current_term->name ?></h1></div>
            <div class="reght_pagenation">
                <?php if (function_exists('yoast_breadcrumb')) {
                    yoast_breadcrumb('', '');
                } ?>
            </div>
        </div>

    </div><!-- end page title -->

    <div class="clearfix"></div>

    <div class="container">

        <div class="content_fullwidth">

            <div class="pricing-tables-main">

                <h2>Thông tin</h2>

                <div class="one_full">
                    <?php echo term_description(); ?>
                </div>

                <div class="mar_top3"></div>
                <div class="clearfix"></div>

                    <?php $i = 1;
                    while (have_posts()): the_post();

                        $product_fields = Azio_Posts::getProductField(get_the_ID());

                        if ($product_fields['featured'] == true) {
                            $class = 'class="pricing-tables-helight"';

                        } else {
                            $class = 'class="pricing-tables"';
                        }

                        if ($current_term->slug == 'web-hosting') {
                            $plan_style = 'style="width: 19.8%;"';

                        } else {
                            $plan_style = '';
                        }

                        ?>


                        <div <?php echo $class ?> <?php echo $plan_style ?>>
                            <div class="title"><?php the_title() ?></div>
                            <div class="price"><?php echo number_format($product_fields['gia'], 0, ',', ','); ?> ₫
                                <i>/ <?php echo $product_fields['donvithanhtoan'] ?></i></div>
                            <div class="cont-list">
                                <ul>
                                    <?php $i == 1;
                                    foreach ($product_fields['thongso'] as $thongso) {
                                        if ($i == count($product_fields['thongso']))
                                            $class_last = 'class="last"';
                                        else
                                            $class_last = '';
                                        echo '<li ' . $class_last . '>' . $thongso['thongso_chitiet'] . '</li>';
                                    } ?>
                                </ul>
                            </div>
                            <div class="ordernow"><a href="#" class="button orange small colorchan">Đặt hàng</a></div>
                        </div>
                        <!-- end section -->

                        <?php $i++;
                    endwhile ?>

            </div>
            <!-- end pricing tables with 4 columns -->


            <div class="clearfix divider_line"></div>


        </div>

    </div><!-- end hosting plan details -->


    <div class="clearfix mar_top4"></div>

<?php get_footer() ?>